home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / tlxjwpc5.zip / EXECPC.SLT < prev    next >
Text File  |  1990-09-21  |  5KB  |  161 lines

  1. //╔═════════════════════════════════════════════════════════════════════╗
  2. //║ RBBS 17.3A         JW-PC Consulting DataFlex.HST      (608)837-1923 ║
  3. //║ Dual Std HST/V.32/MNP5/V.42     RBBSnet 8:972/2     FIDOnet 1:121/8 ║
  4. //╚═════════════════════════════════════════════════════════════════════╝
  5. /////////////////////////////  EXEC.SLT  ///////////////////////////////////
  6. // By Jim Wargula, Sysop JW-PC Consulting DataFlex.HST (608)837-1923
  7. // 09-21-90              8:972/2   and   1:121/8
  8. // This is a sample script for logging on to EXEC-PC of Milwaukee, WI.
  9. // The logon questions are handled in any order, and optional prompts are ok.
  10. // Capture file is opened for new files.  BBSname displayed on Status line.
  11.  
  12. str first_name[] = "Jim";
  13. str last_name[] = "Wargula";
  14.  
  15. // Put YOUR name in the above lines. The script will get the proper password
  16. // stored in your Telix dialing directory.
  17. // (Telix puts that password in the script system variable called _entry_pass).
  18. // Before using this script for the first time, or when you make a change,
  19. // type 'cs exec' at the DOS prompt to compile the script for use by Telix.
  20.  
  21. //////////////////////////////////////////////////////////////////////////////
  22. //  globals
  23. //
  24.  
  25. // used by showname():
  26. //
  27. int       statline =  24;                     // Telix status line row
  28. int       statback =   7;                     // status line background color
  29. int       statfore =   0;                     // status line foreground color
  30.  
  31. //////////////////////////////////////////////////////////////////////////////
  32. //  main routine
  33. //
  34.  
  35. main()
  36.  
  37. {
  38.  alarm (1);
  39.  
  40.  int stat;
  41.  
  42.  int t1, t2, t3, t4, t5, t6, t7, t8, t9;
  43.  
  44.  int tmark;
  45.  
  46.  alarm(1);                              // connect!
  47.  showname();
  48.  
  49.  if (not _entry_pass)                   // no pass, so didn't recog. board
  50.   {
  51.    prints ("Sorry, I don't know the password for this BBS!");
  52.    return;
  53.   }
  54.  
  55.  t1 = track ("FIRST name ->", 1);
  56.  t2 = track ("LAST name ->", 1);
  57.  t3 = track ("Password ->", 1);
  58.  t4 = track ("L=list again) ->", 1);
  59.  t5 = track ("<F>ile", 1);
  60.  t6 = track ("<A> DUC Mahoney", 1);
  61.  t7 = track ("<N>ew", 1);
  62.  
  63.  tmark = timer_start (1800);            // wait up to 3 minutes for login Part I
  64.  
  65. //////////////////////////////////////////////////////////////////////////////
  66. //  Loop  - Login, check new files (capture in file).
  67. //
  68.  
  69.  while (not time_up (tmark))
  70.   {
  71.    terminal();                          // let Telix process any chars and keys
  72.  
  73.    stat = track_hit (0);                // see which (if any) track was hit
  74.  
  75.    if (stat == t1)                      // send name and password
  76.     {
  77.      cputs (first_name);
  78.      cputs ("^M");
  79.     }
  80.    else if (stat == t2)
  81.     {
  82.      cputs (last_name);
  83.      cputs ("^M");
  84.     }
  85.    else if (stat == t3)
  86.     {
  87.      delay (2);
  88.      cputs (_entry_pass);                        // send password
  89.      cputs("^M");
  90.     }
  91.    else if (stat == t4)                 // bulletins
  92.     {
  93.      cputs ("^M");
  94.     }
  95.    else if (stat == t5)                 // Files
  96.     {
  97.      cputs ("F");
  98.     }
  99.    else if (stat == t6)                 // A collection
  100.     {
  101.      cputs ("A");
  102.     }
  103.    else if (stat == t7)                 // New files
  104.     {
  105.      cputs ("N");
  106.      if (capture("exec.cap") == -1)
  107.          prints("Error opening EXEC.CAP capture file...");
  108.      break;
  109.     }
  110.   }
  111.  
  112. //////////////////////////////////////////////////////////////////////////////
  113. //  End  - Clean-up
  114. //
  115.  
  116.  if (time_up (tmark))
  117.     {
  118.     prints ("Loop failed!");
  119.     return;
  120.     }
  121.  
  122.  timer_free (tmark);                    // free timer channel
  123.  track_free (0);                        // and all track channels
  124.  alarm (5);                             // sound alarm, we're there!
  125. }
  126.  
  127. //////////////////////////////////////////////////////////////////////////////
  128. //  Function:     showname
  129. //  Description:  Displays the name of the system you're connected to, or
  130. //                "Alt-Z for Help" if you're not connected to anything.
  131. //
  132. //                You can plug this into ANY logon script file, just call it
  133. //                as shown in main().
  134. //
  135. //                This routine will overwrite the "Alt-Z for Help" message,
  136. //                but I think it's worth it.  If you don't like this feature,
  137. //                set the Anonymous option in SLCONFIG to 'y' (YES).
  138. //  Parameters:   none
  139. //  Returns:      nothing
  140. //
  141. showname()
  142. {
  143.   str       name[14];                         // name to display
  144.   int       x, y;                             // old cursor position
  145.  
  146.   x = getx();                                 // save current position
  147.   y = gety();                                 //
  148.  
  149.   substr(_entry_name, 0, 14, name);           // get the current BBS name
  150.   if ((strlen(name) == 0) || (! carrier()))   // no name or not connected?
  151.     name = "Alt-Z for Help";                  //   then display help message
  152.  
  153.   strcat(name, "              ");             // pad name with spaces
  154.  
  155.   pstraxy( name, 1, statline,                 // display it
  156.            (statback * 16) + statfore
  157.          );
  158.  
  159.   gotoxy(x, y);                               // return to saved position
  160. }
  161.